﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using ScrumTime.Models;

namespace ScrumTime.Services
{
    public class UsabilityAffectedTaskService
    {
        public static UsabilityAffectedTask GetUsabilityAffectedTaskById(ScrumTimeEntities scrumTimeEntities, int id)
        {
            UsabilityAffectedTask usabilityAffectedTask = null;

            var results = from t in scrumTimeEntities.UsabilityAffectedTasks
                          where t.UsabilityAffectedTaskId == id
                          select t;
            if (results.Count() > 0)
                usabilityAffectedTask = results.First<UsabilityAffectedTask>();
            else
                usabilityAffectedTask = new UsabilityAffectedTask();
            return usabilityAffectedTask;
        }
    }
}